package com.zxw.order.service.impl;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxw.common.web.util.JwtUtils;
import com.zxw.order.domain.entity.Order;
import com.zxw.order.domain.vo.OrderPageVO;
import com.zxw.order.mapper.OrderMapper;
import com.zxw.order.service.OrderService;
import com.zxw.user.client.UserClient;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Xuewei.Zhang
 * @since 2022-01-21
 */
@Service
@RequiredArgsConstructor
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

    private final UserClient userClient;

    @Override
    public IPage<Order> getOrderListPageByAnyWhere(OrderPageVO orderPage) {
        userClient.getLoginUserInfo();
        JSONObject jsonObject2 = JwtUtils.getJwtPayload();
        Page<Order> page = new Page<>(orderPage.getPageNum(), orderPage.getPageSize());
        page.setRecords(new ArrayList<>());
        return page;
    }
}
